﻿class com.criticalmass.common.drawing.shapes.Triangle {
	
	private var __mc:MovieClip;
	
/**
* This method draws dashed and dotted lines. It is an extension of the MovieClip Class
* @param x the starting x postion of the arc. This must be the current pen position (usually 0 unless a moveTo() was called)
* @param y the starting y postion of the arc. This must be the current pen position (usually 0 unless a moveTo() was called)
* @param radius the radius of the arc
* @param sweep the sweep of the arc. Negatives draw clockwise
* @param startAngle the length of each segment
* @param yRadius (optional) yRadius of the arc
* @param l (optional) a lineStyle object to use for the line consisting of thickness, col, and alpha
* @param c hex color of fill :: number or array [0x######,0x######]
* @param alpha alpha value of fill :: number or array [0x######,0x######]
* @param gradient type of gradient "linear" or "radial"
* @param ratios (optional :: default  [0,255]) - specifies the distribution of colors :: array [#,#];
* @param rot rotation of fill :: number or matrix object  {matrixType:"box",x:#,y:#,w:#,h:#,r:(#*(Math.PI/180))}
*/

	public function Triangle(mc, x, y, x1, y1, x2, y2, x3, y3, fill){
		
		 __mc = mc.createEmptyMovieClip('wedgeHolder'+mc.getNextHighestDepth()+'_mc', mc.getNextHighestDepth());
		 __mc._x = x;
		 __mc._y = y;
		
		if (arguments.length < 8) {
			trace("Error = not enough arguments");
		} else {
			__mc.beginFill (fill);
			__mc.moveTo(x1, y1);
			__mc.lineTo(x2, y2);
			__mc.lineTo(x3, y3);
			__mc.lineTo(x1, y1);
			
			__mc.endFill();
		}
	};
	
	/*
		Method returns the path to clip holding the drawn object
	*/
	
	public function getTriangle():MovieClip {
		return __mc;
	}

}